package org.kernely.stream.userpage;

import org.kernely.ui.mvp.IKernelyView;

import com.vaadin.terminal.ExternalResource;
import com.vaadin.ui.Alignment;
import com.vaadin.ui.Component;
import com.vaadin.ui.Label;
import com.vaadin.ui.Panel;
import com.vaadin.ui.TabSheet;
import com.vaadin.ui.VerticalLayout;
import com.vaadin.ui.themes.Reindeer;

public class StreamUserPageView extends VerticalLayout implements IKernelyView {

	/**
	 * The view ID, for the association between views and presenters
	 */
	public final static Class<? extends IKernelyView> ID_VIEW = StreamUserPageView.class;

	private TabSheet tabsheet;
	private Panel headerStreamPanel;
	private Label title;
	
	public StreamUserPageView(){
		title = new Label("Stream page");
		title.setSizeUndefined();
		title.setStyleName(Reindeer.LABEL_H1);
		title.setIcon(new ExternalResource("/streambundle/images/stream_32*32.png"));

		VerticalLayout vlayout = new VerticalLayout();
		this.headerStreamPanel = new Panel();
		this.headerStreamPanel.setContent(vlayout);
		
		vlayout.addComponent(title);
		vlayout.setMargin(true, false, true, false);
		vlayout.setComponentAlignment(title, Alignment.MIDDLE_CENTER);
		headerStreamPanel.setSizeFull();

		this.tabsheet = new TabSheet();
		this.tabsheet.setSizeFull();
		
		this.addComponent(headerStreamPanel);
		this.addComponent(tabsheet);
	}
	
	/**
	 * Unused method.
	 */
	@Override
	public final Component getComponent() {
		return this;
	}

	/**
	 * Gets the tabsheet
	 * @return the tabsheet
	 */
	public final TabSheet getTabsheet() {
		return tabsheet;
	}

}
